<?php
// 链接数据库判断 
$link = @new mysqli("127.0.0.1", "root", "root", "school");
// 判断 链接是否成功 
if($link->connect_errno){
	exit($link->connect_error."code:".$link->connect_errno);
}
// 设置编码
$link->query('set names utf8');

// 组预准备语句
$sql = "insert into stu (sname,age,sex) values(?,?,?)";
//执行语句
$stmp = $link->prepare($sql);

if($stmp){

	$stmp->bind_param('sis',$sname,$age,$sex);
	
	for ($i=0; $i <2000 ; $i++) { 
		$sname = "小马".$i;
		$age = 20;
		$sex= "男";
		$stmp->execute();
	}
}
